<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>PhysiTrack: D:/physi-tracklast/01/Android/PhysiTrack/src/image/PhysiObject.java Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">PhysiTrack
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">D:/physi-tracklast/01/Android/PhysiTrack/src/image/PhysiObject.java</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_physi_object_8java.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00002"></a>00002 <span class="keyword">package </span>image;
<a name="l00003"></a>00003 
<a name="l00004"></a>00004 <span class="keyword">import</span> process.*;
<a name="l00005"></a>00005 
<a name="l00007"></a><a class="code" href="classimage_1_1_physi_object.html">00007</a> <span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="classimage_1_1_physi_object.html">PhysiObject</a> {
<a name="l00008"></a>00008 
<a name="l00009"></a><a class="code" href="classimage_1_1_physi_object.html#a1ef4d0859555132ada81d9bff7292607">00009</a>         <span class="keyword">private</span> <span class="keywordtype">double</span> <a class="code" href="classimage_1_1_physi_object.html#a1ef4d0859555132ada81d9bff7292607">posX</a>;
<a name="l00010"></a><a class="code" href="classimage_1_1_physi_object.html#a2e62cb412a8d91282790d845dee5a92e">00010</a>         <span class="keyword">private</span> <span class="keywordtype">double</span> <a class="code" href="classimage_1_1_physi_object.html#a2e62cb412a8d91282790d845dee5a92e">posY</a>;
<a name="l00011"></a><a class="code" href="classimage_1_1_physi_object.html#a61b31e72f7584b9c2cb1ec34f94b193e">00011</a>         <span class="keyword">private</span> <span class="keywordtype">long</span> <a class="code" href="classimage_1_1_physi_object.html#a61b31e72f7584b9c2cb1ec34f94b193e">timestamp</a>;
<a name="l00012"></a><a class="code" href="classimage_1_1_physi_object.html#a49f88672ec134edea8e83ee26acaf96d">00012</a>         <span class="keyword">private</span> <span class="keywordtype">double</span> <a class="code" href="classimage_1_1_physi_object.html#a49f88672ec134edea8e83ee26acaf96d">vX</a>;
<a name="l00013"></a><a class="code" href="classimage_1_1_physi_object.html#a7cb837df8bde4e7b466cde4d17590085">00013</a>         <span class="keyword">private</span> <span class="keywordtype">double</span> <a class="code" href="classimage_1_1_physi_object.html#a7cb837df8bde4e7b466cde4d17590085">vY</a>;
<a name="l00014"></a><a class="code" href="classimage_1_1_physi_object.html#a1201551da3d1b2e093b787e26a2d4bcf">00014</a>         <span class="keyword">private</span> <span class="keywordtype">double</span> <a class="code" href="classimage_1_1_physi_object.html#a1201551da3d1b2e093b787e26a2d4bcf">aX</a>;
<a name="l00015"></a><a class="code" href="classimage_1_1_physi_object.html#a32ae64878329a43ccec57f3a75d3e594">00015</a>         <span class="keyword">private</span> <span class="keywordtype">double</span> <a class="code" href="classimage_1_1_physi_object.html#a32ae64878329a43ccec57f3a75d3e594">aY</a>;
<a name="l00016"></a><a class="code" href="classimage_1_1_physi_object.html#a34d922e8d81e1421a23618ce5593f310">00016</a>         <span class="keyword">private</span> KalmanFilter <a class="code" href="classimage_1_1_physi_object.html#a34d922e8d81e1421a23618ce5593f310">yFilter</a>;
<a name="l00017"></a><a class="code" href="classimage_1_1_physi_object.html#ad9d61066c618a9c1d0f4e766049863ae">00017</a>         <span class="keyword">private</span> KalmanFilter <a class="code" href="classimage_1_1_physi_object.html#ad9d61066c618a9c1d0f4e766049863ae">xFilter</a>;
<a name="l00018"></a>00018 
<a name="l00019"></a>00019         <span class="comment">// ! Konstruktor</span>
<a name="l00020"></a>00020         <span class="comment">/*</span>
<a name="l00021"></a>00021 <span class="comment">         * ! \param message string</span>
<a name="l00022"></a>00022 <span class="comment">         */</span>
<a name="l00023"></a><a class="code" href="classimage_1_1_physi_object.html#afd46db2e5d34d817747dfd8c320ef77c">00023</a>         <span class="keyword">public</span> <a class="code" href="classimage_1_1_physi_object.html#afd46db2e5d34d817747dfd8c320ef77c">PhysiObject</a>(<span class="keywordtype">double</span> sigmaM, <span class="keywordtype">double</span> sigmaW) {
<a name="l00024"></a>00024                 <a class="code" href="classimage_1_1_physi_object.html#a1ef4d0859555132ada81d9bff7292607">posX</a> = 0;
<a name="l00025"></a>00025                 <a class="code" href="classimage_1_1_physi_object.html#a2e62cb412a8d91282790d845dee5a92e">posY</a> = 0;
<a name="l00026"></a>00026                 <a class="code" href="classimage_1_1_physi_object.html#a49f88672ec134edea8e83ee26acaf96d">vX</a> = 0;
<a name="l00027"></a>00027                 <a class="code" href="classimage_1_1_physi_object.html#a7cb837df8bde4e7b466cde4d17590085">vY</a> = 0;
<a name="l00028"></a>00028                 <a class="code" href="classimage_1_1_physi_object.html#a1201551da3d1b2e093b787e26a2d4bcf">aX</a> = 0;
<a name="l00029"></a>00029                 <a class="code" href="classimage_1_1_physi_object.html#a32ae64878329a43ccec57f3a75d3e594">aY</a> = 0;
<a name="l00030"></a>00030                 <a class="code" href="classimage_1_1_physi_object.html#a34d922e8d81e1421a23618ce5593f310">yFilter</a> = <span class="keyword">new</span> KalmanFilter(sigmaM, sigmaW);
<a name="l00031"></a>00031                 <a class="code" href="classimage_1_1_physi_object.html#ad9d61066c618a9c1d0f4e766049863ae">xFilter</a> = <span class="keyword">new</span> KalmanFilter(sigmaM, sigmaW);
<a name="l00032"></a>00032         }
<a name="l00033"></a>00033 
<a name="l00034"></a>00034         <span class="comment">// ! adattagokat aktualizalo fuggveny</span>
<a name="l00035"></a>00035         <span class="comment">/*</span>
<a name="l00036"></a>00036 <span class="comment">         * ! \param int img OwnImae class \param int long aktualis ido</span>
<a name="l00037"></a>00037 <span class="comment">         */</span>
<a name="l00038"></a><a class="code" href="classimage_1_1_physi_object.html#aeca2518ae444361efb9050a732dfd341">00038</a>         <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classimage_1_1_physi_object.html#aeca2518ae444361efb9050a732dfd341">actualize</a>(<a class="code" href="classimage_1_1_own_image.html">OwnImage</a> img) <span class="keywordflow">throws</span> <a class="code" href="classprocess_1_1_image_error_exception.html">ImageErrorException</a> {
<a name="l00039"></a>00039                 <span class="keywordtype">int</span>[] pos = ProcIm.getPos(img.Data);
<a name="l00040"></a>00040                 <span class="keywordtype">double</span> t = img.timestamp - <a class="code" href="classimage_1_1_physi_object.html#a61b31e72f7584b9c2cb1ec34f94b193e">timestamp</a>/(double)1000;
<a name="l00041"></a>00041 
<a name="l00042"></a>00042                 <span class="keywordtype">double</span>[] res = <a class="code" href="classimage_1_1_physi_object.html#ad9d61066c618a9c1d0f4e766049863ae">xFilter</a>.filter(t, pos[0]);
<a name="l00043"></a>00043                 <a class="code" href="classimage_1_1_physi_object.html#a1ef4d0859555132ada81d9bff7292607">posX</a> = res[0];
<a name="l00044"></a>00044                 <a class="code" href="classimage_1_1_physi_object.html#a49f88672ec134edea8e83ee26acaf96d">vX</a> = res[1];
<a name="l00045"></a>00045                 <a class="code" href="classimage_1_1_physi_object.html#a1201551da3d1b2e093b787e26a2d4bcf">aX</a> = res[2];
<a name="l00046"></a>00046 
<a name="l00047"></a>00047                 res = <a class="code" href="classimage_1_1_physi_object.html#a34d922e8d81e1421a23618ce5593f310">yFilter</a>.filter(t, pos[1]);
<a name="l00048"></a>00048                 <a class="code" href="classimage_1_1_physi_object.html#a2e62cb412a8d91282790d845dee5a92e">posY</a> = res[0];
<a name="l00049"></a>00049                 <a class="code" href="classimage_1_1_physi_object.html#a7cb837df8bde4e7b466cde4d17590085">vY</a> = res[1];
<a name="l00050"></a>00050                 <a class="code" href="classimage_1_1_physi_object.html#a32ae64878329a43ccec57f3a75d3e594">aY</a> = res[2];
<a name="l00051"></a>00051                 <a class="code" href="classimage_1_1_physi_object.html#a61b31e72f7584b9c2cb1ec34f94b193e">timestamp</a> = img.timestamp;
<a name="l00052"></a>00052         }
<a name="l00053"></a>00053 
<a name="l00054"></a>00054         <span class="comment">// ! PosX visszateritese</span>
<a name="l00055"></a>00055         <span class="comment">/*</span>
<a name="l00056"></a>00056 <span class="comment">         * ! \return int</span>
<a name="l00057"></a>00057 <span class="comment">         */</span>
<a name="l00058"></a><a class="code" href="classimage_1_1_physi_object.html#a262f2ca3a83e956fb2658146c1aada5e">00058</a>         <span class="keyword">public</span> <span class="keywordtype">double</span> <a class="code" href="classimage_1_1_physi_object.html#a262f2ca3a83e956fb2658146c1aada5e">getPosX</a>() {
<a name="l00059"></a>00059                 <span class="keywordflow">return</span> <a class="code" href="classimage_1_1_physi_object.html#a1ef4d0859555132ada81d9bff7292607">posX</a>;
<a name="l00060"></a>00060         }
<a name="l00061"></a>00061 
<a name="l00062"></a>00062         <span class="comment">// ! Posy visszateritese</span>
<a name="l00063"></a>00063         <span class="comment">/*</span>
<a name="l00064"></a>00064 <span class="comment">         * ! \return int</span>
<a name="l00065"></a>00065 <span class="comment">         */</span>
<a name="l00066"></a><a class="code" href="classimage_1_1_physi_object.html#a6d25f8b00d5bdc3fd65e0dc6d51a9524">00066</a>         <span class="keyword">public</span> <span class="keywordtype">double</span> <a class="code" href="classimage_1_1_physi_object.html#a6d25f8b00d5bdc3fd65e0dc6d51a9524">getPosY</a>() {
<a name="l00067"></a>00067                 <span class="keywordflow">return</span> <a class="code" href="classimage_1_1_physi_object.html#a2e62cb412a8d91282790d845dee5a92e">posY</a>;
<a name="l00068"></a>00068         }
<a name="l00069"></a>00069 
<a name="l00070"></a>00070         <span class="comment">// ! sebesseg visszateritese</span>
<a name="l00071"></a>00071         <span class="comment">/*</span>
<a name="l00072"></a>00072 <span class="comment">         * ! \return double</span>
<a name="l00073"></a>00073 <span class="comment">         */</span>
<a name="l00074"></a><a class="code" href="classimage_1_1_physi_object.html#a97d698f73dc0d853c60987da8129fd1a">00074</a>         <span class="keyword">public</span> <span class="keywordtype">double</span> <a class="code" href="classimage_1_1_physi_object.html#a97d698f73dc0d853c60987da8129fd1a">getVelocity</a>() {
<a name="l00075"></a>00075                 <span class="keywordflow">return</span> Math.sqrt(<a class="code" href="classimage_1_1_physi_object.html#a49f88672ec134edea8e83ee26acaf96d">vX</a> * <a class="code" href="classimage_1_1_physi_object.html#a49f88672ec134edea8e83ee26acaf96d">vX</a> + <a class="code" href="classimage_1_1_physi_object.html#a7cb837df8bde4e7b466cde4d17590085">vY</a> * <a class="code" href="classimage_1_1_physi_object.html#a7cb837df8bde4e7b466cde4d17590085">vY</a>);
<a name="l00076"></a>00076         }
<a name="l00077"></a>00077 
<a name="l00078"></a>00078         <span class="comment">// ! gyorsulas visszateritese</span>
<a name="l00079"></a>00079         <span class="comment">/*</span>
<a name="l00080"></a>00080 <span class="comment">         * ! \return double</span>
<a name="l00081"></a>00081 <span class="comment">         */</span>
<a name="l00082"></a><a class="code" href="classimage_1_1_physi_object.html#abccdec07cc0bd7e85cb25bca12ba90ea">00082</a>         <span class="keyword">public</span> <span class="keywordtype">double</span> <a class="code" href="classimage_1_1_physi_object.html#abccdec07cc0bd7e85cb25bca12ba90ea">getAcceleration</a>() {
<a name="l00083"></a>00083                 <span class="keywordflow">return</span> Math.sqrt(<a class="code" href="classimage_1_1_physi_object.html#a1201551da3d1b2e093b787e26a2d4bcf">aX</a> * <a class="code" href="classimage_1_1_physi_object.html#a1201551da3d1b2e093b787e26a2d4bcf">aX</a> + <a class="code" href="classimage_1_1_physi_object.html#a32ae64878329a43ccec57f3a75d3e594">aY</a> * <a class="code" href="classimage_1_1_physi_object.html#a32ae64878329a43ccec57f3a75d3e594">aY</a>);
<a name="l00084"></a>00084         }
<a name="l00085"></a>00085         <span class="comment">// ! adattomb visszateritese</span>
<a name="l00086"></a>00086         <span class="comment">/*</span>
<a name="l00087"></a>00087 <span class="comment">         * ! \return double array</span>
<a name="l00088"></a>00088 <span class="comment">         */</span>
<a name="l00089"></a><a class="code" href="classimage_1_1_physi_object.html#a7a7affd56f9233cd6de42c388d3fd611">00089</a>         <span class="keyword">public</span> <span class="keywordtype">double</span>[] <a class="code" href="classimage_1_1_physi_object.html#a7a7affd56f9233cd6de42c388d3fd611">getData</a>() {
<a name="l00090"></a>00090                 <span class="keywordtype">double</span>[] result = <span class="keyword">new</span> <span class="keywordtype">double</span>[5];
<a name="l00091"></a>00091                 result[0] = <a class="code" href="classimage_1_1_physi_object.html#a61b31e72f7584b9c2cb1ec34f94b193e">timestamp</a> / (double) 1000;
<a name="l00092"></a>00092                 result[1] = <a class="code" href="classimage_1_1_physi_object.html#a1ef4d0859555132ada81d9bff7292607">posX</a>;
<a name="l00093"></a>00093                 result[2] = <a class="code" href="classimage_1_1_physi_object.html#a2e62cb412a8d91282790d845dee5a92e">posY</a>;
<a name="l00094"></a>00094                 result[3] = <a class="code" href="classimage_1_1_physi_object.html#a97d698f73dc0d853c60987da8129fd1a">getVelocity</a>();
<a name="l00095"></a>00095                 result[4] = <a class="code" href="classimage_1_1_physi_object.html#abccdec07cc0bd7e85cb25bca12ba90ea">getAcceleration</a>();
<a name="l00096"></a>00096                 <span class="keywordflow">return</span> result;
<a name="l00097"></a>00097         }
<a name="l00098"></a>00098 }
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Fri Jun 8 2012 00:07:22 for PhysiTrack by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
